import { request } from "@/utils";


//获取频道
export  const getChannelsAPI = ()=>{
    return request.get('/channels')
}

//发布文章 
export const publishActiveAPI = (date)=>{
    return request.post('/mp/articles?draft=false',date)
}



//获取文章列表
export const getActiveListAPI = (params)=>{
    return request.get('/mp/articles',params)
}


//通过ID进行删除文章信息
export const delActiveByIdAPI=(id)=>{
    return request.delete(`/mp/articles/${id}`)
}

//通过ID获取文章信息
export const getActiveByIdAPI=(id)=>{
    return request.get(`/mp/articles/${id}`)
}


//更新文章信息
export const updateActiveByIdAPI =(date)=>{
    return request.put(`/mp/articles/${date.id}?draft=true`,date)
}